package com.touzhijia;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.ldap.repository.config.EnableLdapRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.spring.annotation.MapperScan;

import java.util.TimeZone;


/**
 * 应用启动类
 * <p>
 * 作者：lizw <br/>
 * 创建时间：2017/5/27 11:50 <br/>
 */
@EnableAsync
@EnableScheduling
@EnableLdapRepositories
@RestController
@EnableTransactionManagement
@MapperScan(basePackages = "com.touzhijia.authority.mapper")
@SpringBootApplication
public class StartApp {
    public static void main(String[] args) {
        //设置默认时区
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
        SpringApplication.run(StartApp.class, args);
    }

    @RequestMapping("/echo")
    public String echo(@RequestParam(name = "check", required = false) String check, @RequestParam(name = "str", required = false) String str) {
        if (check != null) {
            return check;
        }
        if (str != null) {
            return str;
        }
        return "echo";
    }
}
